home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / db / esm-3.1 / esm-3 / usr / local / sm / src / client / include / volume.h < prev   
Encoding:
C/C++ Source or Header  |  1996-05-05  |  4.0 KB  |  126 lines

  1. #ifndef __VOLUME_H__
  2. #define __VOLUME_H__
  3. /*
  4.  *   $RCSfile: volume.h,v $  
  5.  *   $Revision: 1.1.1.1 $  
  6.  *   $Date: 1996/05/04 21:55:20 $      
  7.  */ 
  8. /**********************************************************************
  9. * EXODUS Database Toolkit Software
  10. * Copyright (c) 1991 Computer Sciences Department, University of
  11. *                    Wisconsin -- Madison
  12. * All Rights Reserved.
  13. *
  14. * Permission to use, copy, modify and distribute this software and its
  15. * documentation is hereby granted, provided that both the copyright
  16. * notice and this permission notice appear in all copies of the
  17. * software, derivative works or modified versions, and any portions
  18. * thereof, and that both notices appear in supporting documentation.
  19. *
  20. * THE COMPUTER SCIENCES DEPARTMENT OF THE UNIVERSITY OF WISCONSIN --
  21. * MADISON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION.  
  22. * THE DEPARTMENT DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES
  23. * WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  24. *
  25. * The EXODUS Project Group requests users of this software to return 
  26. * any improvements or extensions that they make to:
  27. *
  28. *   EXODUS Project Group 
  29. *     c/o David J. DeWitt and Michael J. Carey
  30. *   Computer Sciences Department
  31. *   University of Wisconsin -- Madison
  32. *   Madison, WI 53706
  33. *
  34. *     or exodus@cs.wisc.edu
  35. *
  36. * In addition, the EXODUS Project Group requests that users grant the 
  37. * Computer Sciences Department rights to redistribute these changes.
  38. **********************************************************************/
  39.  
  40. #include "io.h"        /* from top-level include dir. */
  41. #include "forward.h"
  42. #include "VOLIDCLASS.h"
  43.  
  44. /* 
  45.  * The definition of the VolDev table.
  46.  * The following type structure definition is used both for the table
  47.  * of mounted volumes (VolDev) and the first page of the volume.
  48.  */
  49. class  VOLREC  {
  50. public:
  51.     _VOLUMENAME_    volName;                /* physical name            */
  52.     VOLID        volid;                    /* Volume ID                */
  53.     SERVERINFO    *serverInfo;            /* server for this volume     */
  54.     UONE        flags;                    /* VOL_MOUNTED, etc,  below */
  55.     UONE        properties;                /* VOL_TEMP, etc.  in io.h  */
  56.     LISTELEMENT    hashList;
  57.  
  58.     inline BOOL equalFunc(VOLREC *other) const {
  59.          return other->volid == this->volid; 
  60.      };
  61.     inline int hashFunc() const { return (int)(this->volid); };
  62.     void Dump(FILE *f);
  63.     VOLIDCLASS *keylocation (int unique, VOLIDCLASS **unused);
  64.     LISTELEMENT *listlocation (int unique);
  65.     void ReInit(); 
  66.     void Init();
  67. }; /* VOLREC */
  68.  
  69. #define VOL_FREE            0x0        /* volume has not been used */
  70. #define VOL_TEMP            VOLPROP_TEMP
  71. #define VOL_LOG                VOLPROP_LOG
  72. #define VOL_MOUNTED            0x1        /* Have sent a mount request for this vol
  73.                                      * since connecting  to the server.  
  74.                                      * We can get a cx established to the
  75.                                      * server under the aegis of another volume.
  76.                                      * so we might find that we're connected
  77.                                      * to this volume's server but never 
  78.                                      * mounted this volume.
  79.                                      * This flags is unset when
  80.                                      * we discover that the server has  
  81.                                      * disconnected us, or we explicitly
  82.                                      * dismount the volume.
  83.                                      */
  84. #define VOL_CLIENT_MOUNTED    0x2        /* Perhaps isn't VOL_MOUNTED now,
  85.                                      * (server might have disconnected us)
  86.                                      * but was used in some transaction since
  87.                                      * we started running.  This flag is set
  88.                                      * on the first mount, and never unset.
  89.                                      */
  90.  
  91. /* BEGIN visible to user */
  92. /* Flags passed as argument to administrative funcs, such
  93.  * as sm_GetRusage(), to indicate which servers to address
  94.  */
  95. #define VOL_ALL                    0
  96. #define VOL_USED_SINCE_INIT        1
  97. #define VOL_USED_IN_TRANSACTION 2
  98. #define VOL_BY_VOLID             3
  99.  
  100. /* END visible to user */
  101. /* TODO: change all references to VOL_USED_SINCE_INIT */
  102. #define VOL_MOUNTED_SINCE_INIT    VOL_USED_SINCE_INIT
  103.  
  104.  
  105. #ifdef JUNK
  106. /* 
  107.  * used only in the message STAT_VOLUME, which is not
  108.  * in use these days.
  109.  */
  110. typedef struct {
  111.  
  112.     _VOLUMENAME_     volName;
  113.     VOLID        volid;                    /* Volume ID        */
  114.     FOUR        numPages;
  115.     FOUR        numCylinders;
  116.     FOUR        tracksPerCylinder;
  117.     FOUR        pagesPerTrack;
  118.     FOUR        bitmapPages;
  119.     FOUR        numFreePages;
  120.     FLAGS        properties;
  121.  
  122. } VOLSTAT;
  123. #endif JUNK
  124.  
  125. #endif __VOLUME_H__
  126.